<?php
include ('template/header.php');
$id_alumno = $_GET['id_alumno'];
include("db_config.php");
$link = Conectarse();
?>
<div id="content">
    <div id="breadcrumb">Inicio &raquo; Ver alumno</div>
    <div id="titulo">Ver alumno</div>

    <div style="text-align: right;"><a href="javascript:history.back()"><img src="IMG/regresar.gif" alt="Botón" /></a></div>


    <?php
    $instruccion = "  select * from alumno where id_alumno='$id_alumno'";
    $consulta = mysql_query($instruccion, $link)
            or die("Fallo en la consulta");
    // $resultado = mysql_fetch_array ($consulta);

    while ($resultado = mysql_fetch_array($consulta)) {
        $nc = $resultado['nc'];

        $query = "  select proyecto.*,
                    as0.id_asesor as id_asesor0, as0.nombre as nombre0, as0.apellido as apellido0, as0.email as email0, as0.horario as horario0, as0.helun as helun0, as0.hemar as hemar0, as0.hemie as hemie0, as0.hejue as hejue0, as0.hevie as hevie0, as0.hslun as hslun0, as0.hsmar as hsmar0, as0.hsmie as hsmie0, as0.hsjue as hsjue0, as0.hsvie as hsvie0, as0.extension as extension0, as0.especialidad as especialidad0, as0.usuario as usuario0,
                    as1.id_asesor as id_asesor1, as1.nombre as nombre1, as1.apellido as apellido1, as1.email as email1, as1.horario as horario1, as1.helun as helun1, as1.hemar as hemar1, as1.hemie as hemie1, as1.hejue as hejue1, as1.hevie as hevie1, as1.hslun as hslun1, as1.hsmar as hsmar1, as1.hsmie as hsmie1, as1.hsjue as hsjue1, as1.hsvie as hsvie1, as1.extension as extension1, as1.especialidad as especialidad1, as1.usuario as usuario1,
                    as2.id_asesor as id_asesor2, as2.nombre as nombre2, as2.apellido as apellido2, as2.email as email2, as2.horario as horario2, as2.helun as helun2, as2.hemar as hemar2, as2.hemie as hemie2, as2.hejue as hejue2, as2.hevie as hevie2, as2.hslun as hslun2, as2.hsmar as hsmar2, as2.hsmie as hsmie2, as2.hsjue as hsjue2, as2.hsvie as hsvie2, as2.extension as extension2, as2.especialidad as especialidad2, as2.usuario as usuario2,
                    empresa.*, empresa.nombre as nombreempre
                    
                    from proyecto 
                    left join asesor as as0 on as0.usuario = proyecto.usrasesor 
                    left join asesor as as1 on as1.usuario = proyecto.usreva1 
                    left join asesor as as2 on as2.usuario = proyecto.usreva2 
                    left join empresa on proyecto.empresa = empresa.nombre
                    where nc='$nc'";

        $alumno = mysql_query($query, $link) or die("error 2");
        $resultado1 = mysql_fetch_assoc($alumno);
        //var_dump( $resultado1 );
        $id_proyecto = $resultado1['id_proyecto'];
        ?>
        <table width="25%" border="0">
            <tr>
                <td width="34%"><strong>Accion </strong></td>
                <td width="32%" ><a href="conf_delalumno.php?id_alumno=<?php echo $id_alumno ?>"><img src="IMG/borrar.jpeg" width="50" height="54" border="0" align="middle" /></a></td>
                <td width="34%" ><a href="modi_alumno.php?id_alumno=<?php echo $id_alumno ?>"><img src="IMG/modificar.jpg" width="41" height="51" /></a></td>
            </tr>
        </table>

        <table width="100%" border="0">

            <tr>
                <td colspan="6"><div align="center"><strong><font color="#FF3300">Datos del alumno</font></strong></div></td>
            </tr>
            <tr>
                <td width="19%"><strong>Nombre</strong></td>
                <td colspan="2" ><?php echo $resultado['nombre'] . " " . $resultado['apellido']; ?></td>
                <td width="15%"><strong>No. control</strong></td>
                <td width="30%" colspan="2" ><?php echo $resultado['nc']; ?></td>
            </tr>
            <tr>
                <td width="19%"><strong>Carrera</strong></td>
                <td colspan="2" ><?php echo $resultado['carrera'] ?></td>
                <td width="15%"><strong>Ciudad</strong></td>
                <td width="30%" colspan="2" ><?php echo $resultado['ciudad']; ?></td>
            </tr>
            <tr>
                <td width="19%"><strong>Email</strong></td>
                <td colspan="2" ><?php echo $resultado['email']; ?></td>
                <td width="15%"><strong>Direccion</strong></td>
                <td width="30%" colspan="2" ><?php echo $resultado['domicilio']; ?></td>
            </tr>
            <tr>
                <td width="19%"><strong>Telefono(particular)</strong></td>
                <td colspan="2" ><?php echo $resultado['tel1']; ?></td>
                <td width="15%"><strong>Telefono(casa)</strong></td>
                <td width="30%" colspan="2" ><?php echo $resultado['tel2']; ?></td>
            </tr>
            <tr>
                <td width="19%"><strong>Atencion medica</strong></td>
                <td colspan="2" ><?php echo $resultado['atnmedica']; ?></td>
                <td width="15%"><strong>No.Afil.servicio medico</strong></td>
                <td width="30%" colspan="2" ><?php echo $resultado['nroafil']; ?></td>
            </tr>
        <?php } ?> 



        <tr>
            <td colspan="6"><div align="center"><strong><font color="#FF3300">Datos del proyecto </font></strong></div></td>
        </tr>
        <tr>
            <td width="19%"><strong>Nombre</strong></td>
            <td colspan="2" ><?php echo $resultado1['nombre']; ?></td>
            <td width="15%"></td>
            <td width="30%" colspan="2" ></td>
        </tr>
        <tr>
            <td width="19%"><strong>Periodo</strong></td>
            <td colspan="2" >PENDIENTE</td>
            <td width="15%"><strong>No. Residentes</strong></td>
            <td width="30%" colspan="2" ><?php echo $resultado1['vacantes']; ?></td>
        </tr>
        <tr>
            <td colspan="6"><div align="center"><strong><font color="#FF3300">Datos de asesor interno</font></strong></div></td>
        </tr>
        <tr>
            <td width="19%"><strong>Nombre</strong></td>
            <td ><?php echo $resultado1['nombre0']; ?></td>
            <td ><?php echo $resultado1['apellido0']; ?></td>
            <td width="15%"><strong>Extension</strong></td>
            <td width="30%" colspan="2" ><?php echo $resultado1['extension0']; ?></td>
        </tr>
        <tr>
            <td width="19%"><strong>Email</strong></td>
            <td colspan="2" ><?php echo $resultado1['email0']; ?></td>
            <td width="15%"><strong>Especialidad</strong></td>
            <td width="30%" colspan="2" ><?php echo $resultado1['especialidad0']; ?></td>
        </tr>
        <tr>
            <td colspan="6"><div align="center"><strong>Horario</strong></div></td>
        </tr>
        <tr>
            <td width="19%" ><strong>Lunes</strong></td>
            <td width="18%" ><?php echo $resultado1['helun0']; ?></td>
            <td width="18%" ><?php echo $resultado1['hslun0']; ?></td>
            <td width="15%" ><strong>Martes</strong></td>
            <td width="15%" ><?php echo $resultado1['hemar0']; ?></td>
            <td width="15%" ><?php echo $resultado1['hsmar0']; ?></td>
        </tr>
        <tr>
            <td width="19%" ><strong>Miercoles</strong></td>
            <td ><?php echo $resultado1['hemie0']; ?></td>
            <td ><?php echo $resultado1['hsmie0']; ?></td>
            <td width="15%" ><strong>Jueves</strong></td>
            <td width="15%" ><?php echo $resultado1['hejue0']; ?></td>
            <td width="15%" ><?php echo $resultado1['hsjue0']; ?></td>
        </tr>
        <tr>
            <td width="19%" ><strong>Viernes</strong></td>
            <td ><?php echo $resultado1['hevie0']; ?></td>
            <td ><?php echo $resultado1['hsvie0']; ?></td>
            <td width="15%" ><a href="asignar_asesor.php?id_proyecto=<?php echo $id_proyecto ?>&id_alumno=<?php echo $id_alumno ?>"><img src="IMG/asignar.png" width="64" height="64" /></a></td>
            <td width="30%" colspan="2" ><a href="elimina_asesorasig.php?id_proyecto=<?php echo $id_proyecto ?>"><img src="IMG/borrar.jpeg" width="50" height="54" /></a></td>
        </tr>
        <tr>
        <tr>
            <td colspan="6"><div align="center"><strong><font color="#FF3300">Datos de Revisores</font></strong></div></td>
        </tr>
        <tr>
            <td width="19%"><strong>Nombre</strong></td>
            <td ><?php echo $resultado1['nombre1']; ?></td>
            <td ><?php echo $resultado1['apellido1']; ?></td>
            <td width="15%"><strong>Extension</strong></td>
            <td width="30%" colspan="2" ><?php echo $resultado1['extension1']; ?></td>
        </tr>
        <tr>
            <td width="19%"><strong>Email</strong></td>
            <td colspan="2" ><?php echo $resultado1['email1']; ?></td>
            <td width="15%"><strong>especialidad</strong></td>
            <td width="30%" colspan="2" ><?php echo $resultado1['especialidad1']; ?></td>
        </tr>
        <tr>
            <td colspan="6"><div align="center"><strong>Horario</strong></div></td>
        </tr>
        <tr>
            <td width="19%" ><strong>Lunes</strong></td>
            <td width="18%" ><?php echo $resultado1['helun1']; ?></td>
            <td width="18%" ><?php echo $resultado1['hslun1']; ?></td>
            <td width="15%" ><strong>Martes</strong></td>
            <td width="15%" ><?php echo $resultado1['hemar1']; ?></td>
            <td width="15%" ><?php echo $resultado1['hsmar1']; ?></td>
        </tr>
        <tr>
            <td width="19%" ><strong>Miercoles</strong></td>
            <td ><?php echo $resultado1['hemie1']; ?></td>
            <td ><?php echo $resultado1['hsmie1']; ?></td>
            <td width="15%" ><strong>Jueves</strong></td>
            <td width="15%" ><?php echo $resultado1['hejue1']; ?></td>
            <td width="15%" ><?php echo $resultado1['hsjue1']; ?></td>
        </tr>
        <tr>
            <td width="19%" ><strong>Viernes</strong></td>
            <td ><?php echo $resultado1['hevie1']; ?></td>
            <td ><?php echo $resultado1['hsvie1']; ?></td>
            <td width="15%" ><a href="asignar_revisor.php?id_proyecto=<?php echo $id_proyecto ?>"><img src="IMG/asignar.png" width="64" height="64" /></a></td>
            <td width="30%" colspan="2" ></td>
        </tr>
        <tr>
        <tr>
            <td width="19%"><strong>Nombre</strong></td>
            <td ><?php echo $resultado1['nombre2']; ?></td>
            <td ><?php echo $resultado1['apellido2']; ?></td>
            <td width="15%"><strong>Extension</strong></td>
            <td width="30%" colspan="2" ><?php echo $resultado1['extension2']; ?></td>
        </tr>
        <tr>
            <td width="19%"><strong>Email</strong></td>
            <td colspan="2" ><?php echo $resultado1['email2']; ?></td>
            <td width="15%"><strong>Especialidad</strong></td>
            <td width="30%" colspan="2" ><?php echo $resultado1['especialidad2']; ?></td>
        </tr>
        <tr>
            <td colspan="6"><div align="center"><strong>Horario</strong></div></td>
        </tr>
        <tr>
            <td width="19%" ><strong>Lunes</strong></td>
            <td width="18%" ><?php echo $resultado1['helun2']; ?></td>
            <td width="18%" ><?php echo $resultado1['hslun2']; ?></td>
            <td width="15%" ><strong>Martes</strong></td>
            <td width="15%" ><?php echo $resultado1['hemar2']; ?></td>
            <td width="15%" ><?php echo $resultado1['hsmar2']; ?></td>
        </tr>
        <tr>
            <td width="19%" ><strong>Miercoles</strong></td>
            <td ><?php echo $resultado1['hemie2']; ?></td>
            <td ><?php echo $resultado1['hsmie2']; ?></td>
            <td width="15%" ><strong>Jueves</strong></td>
            <td width="15%" ><?php echo $resultado1['hejue2']; ?></td>
            <td width="15%" ><?php echo $resultado1['hsjue2']; ?></td>
        </tr>
        <tr>
            <td width="19%" ><strong>Viernes</strong></td>
            <td ><?php echo $resultado1['hevie2']; ?></td>
            <td ><?php echo $resultado1['hsvie2']; ?></td>
            <td width="15%" ><a href="asignar_revisor2.php?id_proyecto=<?php echo $id_proyecto ?>"><img src="IMG/asignar.png" width="64" height="64" /></a></td>
            <td width="30%" colspan="2" ></td>
        </tr>
        <tr>
            <td colspan="6"><div align="center"><strong><font color="#FF3300">Datos de la empresa</font></strong></div></td>
        </tr>
        <tr>
            <td width="19%"><strong>Nombre</strong></td>
            <td colspan="2" ><?php echo $resultado1['nombreempre']; ?></td>
            <td width="15%"><strong>Ramo</strong></td>
            <td width="30%" colspan="2" ><?php echo $resultado1['ramo']; ?></td>
        </tr>
        <tr>
            <td width="19%"><strong>Direccion</strong></td>
            <td colspan="2" ><?php echo $resultado1['direccion']; ?></td>
            <td width="15%"><strong>RFC</strong></td>
            <td width="30%" colspan="2" ><?php echo $resultado1['rfc']; ?></td>
        </tr>
        <tr>
            <td width="19%"><strong>FAX</strong></td>
            <td colspan="2" ><?php echo $resultado1['tel1']; ?></td>
            <td width="15%"><strong>Telefono (NO celular)</strong></td>
            <td width="30%" colspan="2" ><?php echo $resultado1['tel2']; ?></td>
        </tr>
        <tr>
            <td width="19%"><strong>Titular de la empresa</strong></td>
            <td colspan="2" ><?php echo $resultado1['encargado']; ?></td>
            <td width="15%"><strong>Puesto</strong></td>
            <td width="30%" colspan="2" ><?php echo $resultado1['puestot']; ?></td>
        </tr>
        <tr>
            <td width="19%"><strong>Asesor Externo</strong></td>
            <td colspan="2" ><?php echo $resultado1['asesor']; ?></td>
            <td width="15%"><strong>Puesto</strong></td>
            <td width="30%" colspan="2" ><?php echo $resultado1['puesto']; ?></td>
        </tr>

        <tr>
            <td width="19%"><strong></strong></td>
            <td colspan="2" ></td>
            <td width="15%"><strong></strong></td>
            <td width="30%" colspan="2" ></td>
        </tr>
    </table>			    
